package com.example.forum.services;

import com.example.forum.model.Board;

import java.util.List;

/**
 * @author hanzishuai
 * @date 2025/4/9 17:12
 * @Description
 */
public interface IBoardService {
    /**
     * Created by hanzishuai on 2025/4/9
     *
     * @param num 查询记录的条数
     * @return java.util.List<com.example.forum.model.Board>
     * @Description 查询 num 条记录
     */
    List<Board> selectByNum(Integer num);


    /**
     * Created by hanzishuai on 2025/4/9
     *
     * @param id 板块 Id
     * @return com.example.forum.model.Board
     * @Description 根据板块 Id 查询板块信息
     */
    Board selectById(Long id);


    /**
     * Created by hanzishuai on 2025/4/9
     *
     * @param id 板块 Id
     * @Description 板块中的帖子数量 + 1
     */
    void addOneArticleCountById(Long id);


    /**
     * Created by hanzishuai on 2025/4/12
     *
     * @param id 板块 Id
     * @Description 板块中的帖子数量 - 1
     */
    void subOneArticleCountById(Long id);


    /**
     * Created by hanzishuai on 2025/5/6
     * @param board  板块对象
     * @Description  根据板块对象更新板块
     */
    void update(Board board);


    /**
     * @param board 要发表的板块
     * @Description 发布板块
     */
    void create(Board board);

    /**
     * Created by hanzishuai on 2025/5/7
     * @param name  板块名
     * @Description  根据板块名查询板块
     */
    List<Board> selectByName(String name);
}

